Skip to content

feat: TargetPortNumber int32 to become TargetPorts []Port #1354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

capri-xiyue
Copy link
Contributor

part of #1336

  1. change TargetPortNumber int32 to become TargetPorts []Port, where Port includes only a Number field to start in InferencePool v1.
  2. to avoid break change for now, currently TargetPosts only allows exactly one item

Copy link

netlify bot commented Aug 11, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit b10039a
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/689d00ac98960a000895f07a
😎 Deploy Preview https://deploy-preview-1354--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 11, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 11, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @capri-xiyue. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 11, 2025
@liu-cong
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 11, 2025
@capri-xiyue
Copy link
Contributor Author

/assign @ahg-g

@capri-xiyue
Copy link
Contributor Author

This is ready for early review. I will add additional conversion logic once #1330 gets merged.

/hold until #1330 gets merged

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 11, 2025
@capri-xiyue
Copy link
Contributor Author

/assign @danehans @nirrozenbaum for InferencePool spec change.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: capri-xiyue
Once this PR has been reviewed and has the lgtm label, please ask for approval from ahg-g. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @capri-xiyue! This LGTM, curious what others like @danehans and @nirrozenbaum think.

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @capri-xiyue!

@capri-xiyue capri-xiyue requested a review from robscott August 12, 2025 00:21
Copy link
Contributor

@nirrozenbaum nirrozenbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went over the PR.

the main comment I have is that I think this change is too tightly coupled with a specific way to do DP, while there are potentially multiple ways to do that.

if vLLM decides to shift from multiple ports to something else, we're going to get stuck with an array of size one.
I'm not a big fan of the approach that is suggested in this PR.

if we decide to pursue this path of multiple target ports on the CRD, this PR overall looks good. I left few comments.

Comment on lines -150 to +151
"Default value will be set to InferencePool.Spec.TargetPortNumber if not set.")
"Default value will be set to InferencePool.Spec.TargetPorts if not set.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not so clear what is the expected behavior now.
if multiple port would be defined will IGW collect metrics from all ports?
I assume that was the intention - we should make that clear if yes and also make this flag multi port flag.
and also - we should also make that happen in the metrics collection which is obviously not the case atm.

Copy link
Contributor Author

@capri-xiyue capri-xiyue Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we assume that the length of targetPorts is 1. See
Screenshot 2025-08-12 at 1 02 31 PM

I can add additional info to make it clear currently the length of InferencePool.Spec.TargetPorts is 1

@@ -7,7 +7,8 @@ metadata:
labels:
{{- include "gateway-api-inference-extension.labels" . | nindent 4 }}
spec:
targetPortNumber: {{ .Values.inferencePool.targetPortNumber }}
targetPorts:
- number: {{ .Values.inferencePool.targetPortNumber }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look native.
if we change to targerPorts -> number then we should do the same change in the values.yaml file of the helm chart.

Copy link
Contributor Author

@capri-xiyue capri-xiyue Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this here as currently we just allow one targetPortNumber in targetPorts.(minLength = == maxLength ==1) I agree we should change it once we switch to multiple target ports.

Comment on lines +49 to +52
if len(pool.Spec.TargetPorts) != 1 {
return fmt.Errorf("expected 1 target port, got %d", len(pool.Spec.TargetPorts))
}
reqCtx.TargetEndpoint = pod.Address + ":" + strconv.Itoa(int(pool.Spec.TargetPorts[0].Number))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent example to show a port is a property of a pod and not of the pool.. this comes back to the discussion on #1336

@capri-xiyue capri-xiyue force-pushed the capri-xiyue/target-port-change branch from 1d6392f to a8c8088 Compare August 12, 2025 19:59
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2025
@capri-xiyue capri-xiyue force-pushed the capri-xiyue/target-port-change branch from de34d3d to bde16d2 Compare August 13, 2025 17:26
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2025
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2025
@capri-xiyue capri-xiyue force-pushed the capri-xiyue/target-port-change branch from a1e28ad to 575a9e2 Compare August 13, 2025 20:58
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2025
@capri-xiyue
Copy link
Contributor Author

hold until #1368 gets merged

capri-xiyue and others added 17 commits August 13, 2025 14:07
# Conflicts:
#	api/v1/inferencepool_types.go
#	api/v1/zz_generated.deepcopy.go
#	client-go/applyconfiguration/api/v1/inferencepoolspec.go

# Conflicts:
#	api/v1/zz_generated.deepcopy.go
#	client-go/applyconfiguration/api/v1/inferencepoolspec.go
# Conflicts:
#	pkg/epp/controller/inferencepool_reconciler_test.go
@capri-xiyue capri-xiyue force-pushed the capri-xiyue/target-port-change branch from e4d080e to b10039a Compare August 13, 2025 21:16
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 13, 2025
@k8s-ci-robot
Copy link
Contributor

@capri-xiyue: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-gateway-api-inference-extension-verify-main b10039a link true /test pull-gateway-api-inference-extension-verify-main
pull-gateway-api-inference-extension-test-unit-main b10039a link true /test pull-gateway-api-inference-extension-test-unit-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants